package com.ruoyi.card.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.card.mapper.CardOpenRecordMapper;
import com.ruoyi.card.domain.CardOpenRecord;
import com.ruoyi.card.service.ICardOpenRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 开卡记录Service业务层处理
 * 
 * @author ancyshi
 * @date 2023-06-05
 */
@Service
public class CardOpenRecordServiceImpl implements ICardOpenRecordService 
{
    @Autowired
    private CardOpenRecordMapper cardOpenRecordMapper;

    /**
     * 查询开卡记录
     * 
     * @param openRecordId 开卡记录ID
     * @return 开卡记录
     */
    @Override
    public CardOpenRecord selectCardOpenRecordById(Long openRecordId)
    {
        return cardOpenRecordMapper.selectCardOpenRecordById(openRecordId);
    }

    /**
     * 查询开卡记录列表
     * 
     * @param cardOpenRecord 开卡记录
     * @return 开卡记录
     */
    @Override
    public List<CardOpenRecord> selectCardOpenRecordList(CardOpenRecord cardOpenRecord)
    {
        return cardOpenRecordMapper.selectCardOpenRecordList(cardOpenRecord);
    }

    /**
     * 新增开卡记录
     * 
     * @param cardOpenRecord 开卡记录
     * @return 结果
     */
    @Override
    public int insertCardOpenRecord(CardOpenRecord cardOpenRecord)
    {
        cardOpenRecord.setCreateTime(DateUtils.getNowDate());
        return cardOpenRecordMapper.insertCardOpenRecord(cardOpenRecord);
    }

    /**
     * 修改开卡记录
     * 
     * @param cardOpenRecord 开卡记录
     * @return 结果
     */
    @Override
    public int updateCardOpenRecord(CardOpenRecord cardOpenRecord)
    {
        cardOpenRecord.setUpdateTime(DateUtils.getNowDate());
        return cardOpenRecordMapper.updateCardOpenRecord(cardOpenRecord);
    }

    /**
     * 删除开卡记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCardOpenRecordByIds(String ids)
    {
        return cardOpenRecordMapper.deleteCardOpenRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除开卡记录信息
     * 
     * @param openRecordId 开卡记录ID
     * @return 结果
     */
    @Override
    public int deleteCardOpenRecordById(Long openRecordId)
    {
        return cardOpenRecordMapper.deleteCardOpenRecordById(openRecordId);
    }
}
